﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


using KingRoad.EPM.PersonnelLogEntity.Model;
using Unis.Framework.Core.Utility;
using KingRoad.EPM.PersonnelLogDAL.SpecialPersonnelService;


namespace KingRoad.EPM.PersonnelLogBLL.UIRules
{
    /// <summary> 
    /// 客户端业务处理类。 
    /// 文件生成时间 2017/2/13 20:06:04
    /// </summary> 
    public class ScmSpecialpersonnelUIRule
    {
        private readonly IScmSpecialpersonnelService _scmSpecialpersonnelService;
        
        
        public ScmSpecialpersonnelUIRule(){}
        
        /// <summary> 
        /// construct function... 
        /// </summary> 
        public ScmSpecialpersonnelUIRule(IScmSpecialpersonnelService  scmSpecialpersonnelService)
        {
           _scmSpecialpersonnelService=scmSpecialpersonnelService;
        }

        /// <summary>
        /// 获取特种作业人员台账信息
        /// </summary>
        /// <returns></returns>
        public List<ScmSpecialpersonnelInfo> GetAllSpecialpersonnel()
        {
            var list = _scmSpecialpersonnelService.GetEntityList();
            return list;
        }
         /// <summary>
        /// 根据条件查询费用计划信息
        /// </summary>
        /// <param name="numCurrentPage">当前页</param>
        /// <param name="numPerPage">每页数据大小</param>
        /// <param name="orderByField">排序字段名称</param>
        /// <param name="totalRecord">总数据量</param>
        /// <param name="sqlCondition">sql查询条件</param>
        /// <returns></returns>
        public List<ScmSpecialpersonnelInfo> GetAllCostplanmainForPage(int numCurrentPage, int numPerPage,
                                                                        string orderByField, out int totalRecord, string sqlCondition)
        {
            var list = _scmSpecialpersonnelService.GetEntityListByContionRe(numCurrentPage, numPerPage, orderByField, out totalRecord, sqlCondition);
            return list;
        }
        /// <summary>
        /// 获取特种作业人员台账信息 根据ID获取
        /// </summary>
        /// <returns></returns>
        public ScmSpecialpersonnelInfo GetSpecialpersonnelByID(Guid id)
        {
            var list = _scmSpecialpersonnelService.GetEntityById(id);
            return list;
        }

        /// <summary>
        /// 添加特种作业人员台账信息
        /// </summary>
        /// <returns></returns>
        public int AddSpecialpersonnel(ScmSpecialpersonnelInfo AddEntity)
        {
            return _scmSpecialpersonnelService.InsertEntity(AddEntity);
        }

        /// <summary>
        /// 删除特种作业人员台账信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DeleteSpecialpersonnel(string id)
        {
            return _scmSpecialpersonnelService.DeleteEntityByStringID(id);
        }

        /// <summary>
        /// 删除特种作业人员台账信息(批量删除)
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DeleteSpecialpersonnelMulti(string id)
        {
            return _scmSpecialpersonnelService.DeleteEntityByMultiStringID(id);
        }

        /// <summary>
        /// 添加特种作业人员台账信息
        /// </summary>
        /// <returns></returns>
        public int UpdateSpecialpersonnel(ScmSpecialpersonnelInfo UpdateEntity)
        {
            return _scmSpecialpersonnelService.UpdateEntity(UpdateEntity);
        }
        /// <summary>
        /// 根据标段获取台账信息
        /// </summary>
        /// <param name="section">标段</param>
        /// <returns></returns>
        public List<ScmSpecialpersonnelInfo> GetAllSpecialpersonnelBySection(string sql)
        {

            var list = _scmSpecialpersonnelService.GetEntityList(sql);
            return list;
        }
        /// <summary>
        /// 获取所有的特种作业人员台账信息
        /// </summary>
        /// <param name="numCurrentPage">当前页</param>
        /// <param name="numPerPage">每页数据大小</param>
        /// <param name="orderByField">排序字段名称</param>
        /// <param name="totalRecord">总数据量</param>
        /// <returns></returns>
        public List<ScmSpecialpersonnelInfo> GetAllSpecialpersonnel(int numCurrentPage, int numPerPage, string orderByField, out int totalRecord)
        {
            var list = _scmSpecialpersonnelService.GetEntityListByContion(numCurrentPage, numPerPage, orderByField, out totalRecord);
            return list;
        }

        /// <summary>
        /// 根据条件查询特种作业人员台账信息
        /// </summary>
        /// <param name="numCurrentPage">当前页</param>
        /// <param name="numPerPage">每页数据大小</param>
        /// <param name="orderByField">排序字段名称</param>
        /// <param name="totalRecord">总数据量</param>
        /// <param name="sqlCondition">sql查询条件</param>
        /// <returns></returns>
        public List<ScmSpecialpersonnelInfo> GetSpecialpersonnelForSearch(int numCurrentPage, int numPerPage,
                                                                        string orderByField, out int totalRecord, string sqlCondition)
        {
            var list = _scmSpecialpersonnelService.GetEntityListByContion(numCurrentPage, numPerPage, orderByField, out totalRecord, sqlCondition);
            return list;
        }
    }
}

